<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <div class="datalist"><table id="flexigrid" style="display:none"></table></div>
        <script type="text/javascript">
            $(function() {
                $("#flexigrid").flexigrid($.extend(SG.flexOptions, {
                    url: '<?= site_url('activity/module/flexigrid') ?>',
                    colModel: [
                        {display: '<?= translate('ID') ?>', name: 'id', width: 100,iskey:true, hide:'true'},
                        {display: '<?= translate('ACTIVITY_MODULE_TABLEENUM') ?>', name: 'tableenum', width: 100}, 
                        {display: '<?= translate('ACTIVITY_MODULE_DES') ?>', name: 'des', width: 200},                          
                        {display: '<?= translate('ACTIVITY_MODULE_TABLENAME') ?>', name: 'tablename', width: 200},                                               
                        {display: '<?= translate('MANAGE') ?>', name: 'tableenum', width: 100, sortable: false, process: formatOp}
                    ],
                    buttons: [
                        {name: 'add', displayname: "<?= translate('ADD') ?>", title: "<?= translate('ADD') ?>", bclass: 'add', onpress: multi},
                        //{name: 'edit', displayname: "<?= translate('EDIT') ?>", title: "<?= translate('EDIT') ?>", bclass: 'edit', onpress: multi},
                        {name: 'export', displayname: "<?= translate('EXPORT') ?>", bclass: 'export', onpress: multi},
                        {separator: true}
                    ],
                    searchitems: true,
                }));
                SG.admin = $.extend(SG.admin, {
                    add_url: '<?= site_url("activity/module/add") ?>',
                    del_url: '<?= site_url("activity/module/del/") ?>',
		    		edit_url: '<?= site_url("activity/module/edit/") ?>',
                    //multi_url: '<?= site_url("activity/module/multi/") ?>'
                });

                function formatActObject(value, id, cell, field) {
                    var typearr = <?= json_encode($actobjectlist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                } 
                function formatKind(value, id, cell, field) {
                    var typearr = <?= json_encode($kindlist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                } 
                function formatColor(value, id, cell, field) {
                    var typearr = <?= json_encode($colorlist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                } 
                function formatBagLimit(value, id, cell, field) {
                    var typearr = <?= json_encode($baglimitlist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                } 
                function formatGetType(value, id, cell, field) {
                    var typearr = <?= json_encode($gettypelist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                } 
            });
        </script>
    </body>
</html>